package mmc.gl.shader;

import static org.lwjgl.opengl.GL20.*;

public enum ShaderType {
	FRAGMENT(GL_FRAGMENT_SHADER), VERTEX(GL_VERTEX_SHADER);
	
	private ShaderType(int glConstant){
		this.glConstant = glConstant;
	}
	
	private final int glConstant;
	
	public static ShaderType guessTypeViaName(String name){
		if(name.endsWith(".fs"))
			return FRAGMENT;
		if(name.endsWith(".vs"))
			return VERTEX;
		throw new RuntimeException("Could not guess ShaderType from name: "+name);
	}
	
	public int getGLConstant(){
		return glConstant;
	}
}
